how to filter a list in c#

99

how to filter a list in c# -

using System;
using System.Collections.Generic;

var vals = new List<int> {-1, -3, 0, 1, 3, 2, 9, -4};

List<int> filtered = vals.FindAll(e => e > 0);

Console.WriteLine(string.Join(',', filtered));

Comments

Submit
0 Comments